<?php

namespace app\command;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use app\order\logic\OrderLogic;
use think\facade\Cache;
class AutomaticConsummer extends Command
{

        protected function configure()
        {
                $this->setName('AutomaticConsummer')
                ->setDescription('AutomaticConsummer');
        }

        protected function execute(Input $input, Output $output)
        {
                //临时--拉取多维表格
                // (new OrderLogic())->getTablerecordsPants();
                //自动发货
                // (new OrderLogic())->automaticShippings();
                //回传物流单号
                (new OrderLogic())->tracking_number_update_tk();

                //物流轨迹时效--手动更新未上网
                // (new OrderLogic())->orderValidityNot();

                //物流轨迹时效
                (new OrderLogic())->orderValidity();
                //物流轨迹时效--快速识别是否超时
                (new OrderLogic())->orderValidityTimedOut();

                $ViewTodaysUpdates2 = Cache::store('redis')->get('AutomaticConsummer');
                if (empty($ViewTodaysUpdates2)) {  
                        Cache::store('redis')->set('AutomaticConsummer', 1, 3600 * 24);
                }else{
                        echo '时间没到先不更新';die;
                }


                //物流轨迹时效--物流断更手动更新
                (new OrderLogic())->LogisticsManualUpdate();
        }
}